<?php
/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of Json
 *
 * @author ananda
 */
class Exception_Response_JsonRpc extends Exception_Response
{
    public function __toString()
    {
        return json_encode($this->format());
    }

    protected function format()
    {
        $request = json_decode(file_get_contents('php://input'),true);
        return array(
            'id'     => $request['id'],
            'result' => NULL,
            'error'  => $this->message,
        );
    }

}
